{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\vieww10680\viewh15320\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b\fs30 \cf0 \ul \ulc0 Simple Model Animation System
\b0\fs24 \
\ulnone \
for this project we're going to have simple animations that are based on atomic actions. \
There is  only one model file per level or per game. All the models should be included there\
\
models are texturemaps over some simple geometry - usually a square.\
\
\

\b\fs28 \ul keys\

\fs24 \ulnone \
include filename\

\b0 this pulls in another model file. The filename shouldn't have spaces or non letter characters.\
Models that are pulled in to this file become objects as if they were defined in this file.
\b \
\
model name \

\b0 The model's name is specified - it's not guaranteed that we'll keep that in the game though. \
The model name must have no spaces or non letter characters.\
\

\b center x y\

\b0 This is the center of the model. This allows us to offset the center. \
\

\b scale x y \

\b0 this is the scale of the model. \
\

\b rot r \

\b0 this is the rotation of the model in degrees\
\

\b children \

\b0 Children key must be accompanied by the brackets to encompass the list of children. \
Children must be in their own bracket - with at least the name of the model - we can specify the child's center scale and rot - these values will be applied to the child model before the child model's own transformation is applied. \
\

\b create, die, touchbegin, touchend, \

\b0 Are events - they have a list of actions each action has to be bracketed like the child node, the list also needs to be bracketed. \
\
\
------------\

\b\fs28 \ul actions \

\b0\fs24 \ulnone Actions apply to the model's position, scale and rotation. They also apply to the model's texture. \
\
Actions can be repeating actions, or one time actions (depending on the loop count (0 indefinite, 1 once ...). One time actions are applied once, but their effect is permament. For example if we apply a shrink action, the scale of the model afterwards will be the size specified in the shrink.\
\

\b Transform Actions. \

\b0 Move DeltaPos, Time, LoopCount,  \{Easin/EaseOut/SmoothStep\}\
Translate From, To, Time, LoopCount,  \{Easin/EaseOut/SmoothStep\}\
Scale From, To, Time LoopCount,  \{Easin/EaseOut/SmoothStep\}\
Scale Delta, Time ; for example Scale .2 Time will grow the model by .2 in Time seconds.\
Rotate From, To, Time LoopCount,  \{Easin/EaseOut/SmoothStep\}\
Rotate Delta, Time LoopCount,  \{Easin/EaseOut/SmoothStep\}\
\
Texture Transforms (same as above)\
\

\b Complex Actions\

\b0 Wiggle - rotates back and forth using the model center as the center. \
Wiggle Amp, Freq, Time, LoopCount\
Bob - moves back and forth along a line\
Bob From, To, Freq, Time, LoopCount\
OrientToDirectionOfTravel \
Fadein Time\
Fadeout Time\
\
\
// Model text format  \
\
include filename  include is used to i\
\
// example:\
model name\
	center x y  is the centroid of the model.\
	scale x y \
	rot r     r is in degrees\
	children [[ name offset x y scale x y rot r ]  ] \
	create [  [actions in brackets] \
		   [move .2 .2 1 1 Linear] ]\
	die [ 	[action] [action] \
		[fadeout  0.0] \
		[spawn name_of_model]]\
	touch [ [action] ]\
\

\b cascading actions?\

\b0 Cascading actions are actions that trigger other actions when they are done or when they are done with a loop.\
\
	[ move .2 .2 1 Linear \
		done = [ [spawn name_of_model] ]]\
\
on_complete \
\
struct OnComplete : unary\{\
	object* m_object;\
\
	void operator()(void) \{ m_object->Completed() \}\
\};\
\
setOnCompleteCB( complete(this) );\
\
setOnComplete( CModel::&OnAnimComplete , m_model)\
\{\
	m_model = i_model;\
	completed_cb = OnAnimComplete ;\
\}\
}